package kd.comt.plugin;

import java.util.EventObject;

import kd.bos.form.ShowType;
import kd.bos.form.container.Tab;
import kd.bos.form.control.events.TabSelectEvent;
import kd.bos.form.control.events.TabSelectListener;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.list.ListShowParameter;

public class GXZY extends AbstractFormPlugin implements TabSelectListener{
        //待打开的页面
        private static String zr_KEY_FORMID = "bpgx_gxzrdjb";
        private static String zr_TITLE_zr = "办理转入登记表";

        private static String zc_KEY_FORMID = "bpgx_gxzcdjb";
        private static String zc_TITLE_zr = "办理转出登记表";

    public void registerListener (EventObject e){
        //页签控件添加监听事件
        Tab tab = this.getView().getControl("bpgx_tabap");
        tab.addTabSelectListener(this);
    }
    

    //重写tabSelected方法
    @Override
    public void tabSelected(TabSelectEvent arg0) {
        // TODO Auto-generated method stub
        //获取点击页签的key
        String subTabKey = arg0.getTabKey();

        switch(subTabKey){
            case "bpgx_blzr":
            ListShowParameter list1 =new ListShowParameter();
            list1.setFormId("bos_list");
            list1.setBillFormId(zr_KEY_FORMID);//设置要打开的页面
            list1.getOpenStyle().setShowType(ShowType.InContainer);//打开类型，容器
            list1.getOpenStyle().setTargetKey("bpgx_blzr");//打开至指定容器内
            this.getView().showForm(list1);
            
            case "bpgx_blzc":
            ListShowParameter list2 =new ListShowParameter();
            list2.setFormId("bos_list");
            list2.setBillFormId(zc_KEY_FORMID);//设置要打开的页面
            list2.getOpenStyle().setShowType(ShowType.InContainer);//打开类型，容器
            list2.getOpenStyle().setTargetKey("bpgx_blzc");//打开至指定容器内
            this.getView().showForm(list2);
        }
    }
}
